package com.dingwen.treasure.model.entity.mybatisplus;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 系统角色菜单
 * 角色和菜单对应表
 *
 * @author dingwen
 * @TableName sys_role_menu
 * @date 2022/06/20
 */
@TableName(value ="sys_role_menu")
@ApiModel(value = "sysRoleMenu", description = "角色和菜单对应表")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Data
@EqualsAndHashCode(callSuper = false)
public class SysRoleMenu extends BaseEntity implements Serializable {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 角色ID
     */
    @ApiModelProperty(value = "角色ID")
    @TableField(value = "role_id")
    private Long roleId;

    /**
     * 菜单ID
     */
    @ApiModelProperty(value = "菜单ID")
    @TableField(value = "menu_id")
    private Long menuId;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * toBuilder = true： 可修改
     *
     * @param createTime
     * @param updateTime
     * @param deleted
     * @param version
     * @param createBy
     * @param updateBy
     * @param remark
     */
    @Builder(toBuilder = true)
    public SysRoleMenu(LocalDateTime createTime, LocalDateTime updateTime, Integer deleted, Integer version, String createBy, String updateBy, String remark, Long id, Long roleId, Long menuId) {
        super(createTime, updateTime, deleted, version, createBy, updateBy, remark);
        this.id = id;
        this.roleId = roleId;
        this.menuId = menuId;
    }
}